let context =null 
const initContext=(vue)=>{
	context = vue;
}

//登录
const signinAsync = async(usercell,pwd)=>{
	let requrl=`${context.serverUrl}/Account/Signin`;
	let [error, result] = await uni.request({
		url:requrl,
		method:"POST",
		header: {
			'platform': context.mobileDeviceInfo.platform,
			'uuid': context.mobileDeviceInfo.uuid,
			'model': context.mobileDeviceInfo.model,
		},
		data:{
			UserId:usercell,
			Password:pwd
		}
	});
	if (!error && result.statusCode == 200) {
		return result.data;
	}
	return null;
}

const loginService = {
	initContext,
	signinAsync
}

export default loginService